package com.sctvcloud.zhaohua_sd.ui.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.ruihang.generalibrary.ui.adapter.BaseHolderAbsAdapter;
import com.ruihang.generalibrary.ui.util.OnItemInternalClick;
import com.sctvcloud.zhaohua_sd.R;
import com.sctvcloud.zhaohua_sd.beans.FCollect;
import com.sctvcloud.zhaohua_sd.ui.adapter.holder.MyCollectionHolder;

import java.util.List;

/**
 * Created by Administrator on 2017/6/22 0022.
 */

public class MyCollectionAdapter extends BaseHolderAbsAdapter<FCollect, MyCollectionHolder> {
	public MyCollectionAdapter(Context context, List<FCollect> list) {
		super(context, list);
	}

	@Override
	public MyCollectionHolder onCreateViewHolder(ViewGroup parent, int viewType) {
		View view = LayoutInflater.from(context).inflate(R.layout.item_collection, parent, false);
		MyCollectionHolder holder = new MyCollectionHolder(context, view);
		holder.setInternalClick(this);
		return holder;
	}

	@Override
	public int getItemViewType(int position) {
		return data.get(position).getDataViewType();
	}

	@Override
	public MyCollectionAdapter setItemInternalClick(OnItemInternalClick itemInternalClick) {
		super.setItemInternalClick(itemInternalClick);
		return this;
	}
}
